package com.wwz.leetcode;

import org.junit.Test;



public class LeetCode1037 {

    @Test
    public void test(){
//        int[][] points = {{1, 1}, {2, 3}, {3, 2}};
        int[][] points = {{0, 0}, {0, 2}, {2, 1}};
        boolean b = isBoomerang(points);
        System.out.println(b);
    }
    public boolean isBoomerang(int[][] points) {
        int x1 = points[0][0], y1 = points[0][1];
        int x2 = points[1][0], y2 = points[1][1];
        int x3 = points[2][0], y3 = points[2][1];
        // 把点斜式换成了 乘法  这很巧妙 避免有0的情况
        return (y2 - y1) * (x3 - x2) != (y3 - y2) * (x2 - x1);
    }

}
